<?php
include '../../auth/ceklogin.php';
include "../../sql/conn.php";
if (isset($_POST['q']))
{
    $q = $_POST['q'];
} 
else
{
    $q = '';
}    
$q = str_replace("'", "''", $q);


$query = mysql_query("
        SELECT 
            *
        FROM 
            customer 
        WHERE 
            ( `idCustomer` LIKE '%$q%' or `namaCustomer` LIKE '%$q%') 
        ") or die(mysql_error());		

$data = array(); 
while($row = mysql_fetch_object($query)){
    $data[] = $row; 
}
die(json_encode($data)); 
?>